package ysu.sxm.ptjc.Dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import ysu.sxm.ptjc.Domin.DateRange;
import ysu.sxm.ptjc.Domin.InvalidationReq;
import ysu.sxm.ptjc.pojo.ProRelationInfo;
import ysu.sxm.ptjc.pojo.ProduceInfo;
import ysu.sxm.ptjc.pojo.ProduceStatisticalInfo;

import java.sql.Date;
import java.util.List;

@Repository
@Mapper
public interface ProduceStatisticalInfoDao {
    List<ProduceStatisticalInfo> getProduceStatisticalInfoByDate(Date date);
    List<ProduceStatisticalInfo>getByNumAndDate(@Param("num")ProRelationInfo produceInfo, @Param("date")List<Date> date,@Param("req") InvalidationReq invalidationReq);
    List<ProduceStatisticalInfo>getByNumAndDateRange(@Param("num")ProRelationInfo produceInfo,@Param("DateRange") DateRange d,@Param("req") InvalidationReq invalidationReq);
    //根据产品类型和生产日期获取对象
    List<ProduceStatisticalInfo> getByProduceTypeAndDate(@Param("produceType")String produceType,@Param("start") String start,@Param("end") String end);
    //根据编号生产日期获取对象
    ProduceStatisticalInfo getByProduceNumAndDate(@Param("num") String produceNum, @Param("date") Date date);

    boolean insert(ProduceStatisticalInfo produceStatisticalInfo);
}
